package com.yu.myporject.config;

import com.yu.myporject.domain.Person;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DynamicBeanConfiguration {

    @Bean
    public Person createBean( @Value("${name}") String name,@Value("${age}") int age) {
        Person p= new Person();
        p.setName(name);
        p.setAge(age);
        return p;
    }
}